<template>
    <CommonContainer title="外部转租赁供应商信息">
        <el-descriptions v-if="customerInfo">
            <el-descriptions-item label="外部转租赁禀议编码" v-if="customerInfo.carBasicVo">{{ customerInfo.carBasicVo.outNo|filterNull }}</el-descriptions-item>
            <el-descriptions-item label="供应商名称" v-if="customerInfo.carBasicVo">{{ customerInfo.carBasicVo.outSupplier|filterNull }}</el-descriptions-item>
            <el-descriptions-item label=" 转租赁费用（含税）" v-if="customerInfo.carBasicVo">{{ customerInfo.carBasicVo.outMoney|filterNull }}</el-descriptions-item>
            <el-descriptions-item label="采购类型" v-if="customerInfo.carBasicVo">{{ customerInfo.carBasicVo.purchaseType|filterNull }}</el-descriptions-item>
            <el-descriptions-item label="新车/二手车" v-if="customerInfo.carBasicVo"><dict-tag
                        :options="dict.type.quota_car_type"
                        :value="customerInfo.carBasicVo.carClassification"/></el-descriptions-item>
        </el-descriptions>
    </CommonContainer>
</template>

<script>
import {externalublease} from "@/api/carInventory/inInventory";
export default {
    components: {},
    dicts:['business_type','customer_level','customer_label','quota_car_type'],
    props: {
        value: {
        type: Object,
        },
    },
    data() {
        return {}
    },
    computed:{
        customerInfo: {
            get() {
                return this.value;
                return this.useVModel.call(this);
            },
            set(val) {
                this.$emit("input", val);
            }, 
        },
    },
    methods: {
        // 需要列表带过来的id
        getExternalublease(id){
            
            externalublease(id).then((res)=>{
                if(res.code==200){
                    this.customerInfo.carBasicVo.outNo = res.data?.outNo;
                    this.customerInfo.carBasicVo.outSupplier = res.data?.outSupplier;
                    this.customerInfo.carBasicVo.outMoney = res.data?.outMoney;
                    this.customerInfo.carBasicVo.purchaseType = res.data?.purchaseType;
                    this.customerInfo.carBasicVo.carClassification = res.data?.carClassification;
                }else{

                }
                
            })
        },
        detailInfo(){
            var _this = this;
            if (this.customerInfo != null && this.customerInfo.carBasicVo != null) {
                if(this.customerInfo.inboundId){
                    this.getExternalublease(this.customerInfo.inboundId);
                }
            
            } else {
            setTimeout(function () {
                _this.detailInfo();
            }, 100)
            }
        },
    },
    created() {

        this.detailInfo()
    },

}
</script>

<style lang="scss" scoped>
</style>
